﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KeyValuePair
{
    class Program
    {
        #region Constructors

        static Program()
        {
            m_Values = new List<KeyValuePair<int, string>>();
            m_Values2 = new List<MyKeyValuePair>();

            m_Values.Add(new KeyValuePair<int, string>(1, "Ivan"));
            m_Values.Add(new KeyValuePair<int, string>(2, "Inna"));
            m_Values.Add(new KeyValuePair<int, string>(3, "Vika"));
            m_Values.Add(new KeyValuePair<int, string>(4, "Max"));
            m_Values.Add(new KeyValuePair<int, string>(0, "Goggi"));
            m_Values.Add(new KeyValuePair<int, string>(-1, "Givi"));

            m_Values2.Add(new MyKeyValuePair(1, "Ivan"));
            m_Values2.Add(new MyKeyValuePair(2, "Inna"));
            m_Values2.Add(new MyKeyValuePair(3, "Vika"));
            m_Values2.Add(new MyKeyValuePair(4, "Max"));
            m_Values2.Add(new MyKeyValuePair(0, "Goggi"));
            m_Values2.Add(new MyKeyValuePair(-1, "Givi"));
        }

        #endregion

        static void Main(string[] args)
        {
            var item3 = new MyKeyValuePair(0, "Goggi");
            int index2 = m_Values2.IndexOf(item3);


            var item2 = new KeyValuePair<int, string>(0, "Goggi");
            int index = m_Values.IndexOf(item2);

            int code = item2.GetHashCode();

            if (index != index2)
            {
                throw new InvalidOperationException();
            }

            Console.WriteLine("=========== Done! ==============");

            Console.ReadLine();        
        }

        #region Private Fields

        private static readonly List<KeyValuePair<int, string>> m_Values = null;
        private static readonly List<MyKeyValuePair> m_Values2 = null;

        #endregion
    }
}
